<%@ page contentType="text/html; charset=utf-8" %>
<%
	request.setAttribute("path", request.getContextPath());
%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>致-青春 注册</title>
	<link rel="stylesheet" type="text/css" href="${path}/css/base.css" />
	<script type="text/javascript" src="${path}/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="${path}/js/jquery.zhi-qingchun-0.1.js"></script>
	<script type="text/javascript">
		function check() {
			$("input").each(function(){
				$(this).wipe();
			});
			
			var email = $("input[name='email']");
			if (email.val() == "") {
				email.er("帐号不能为空");
				return false;
			} else {
				var emailPattern = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
				if (! emailPattern.test(email.val())) {
					email.er("帐号必须为email");
					return false;
				}
			}
			
			var pwd = $("input[name='pwd']");
			if (pwd.val() == "") {
				pwd.er("密码不能为空");
				return false;
			} 
			
			var usr = $("input[name='usr']");
			if (usr.val() == "") {
				usr.er("名号不能为空");
				return false;
			} 
			
			return true;
		}
	</script>
</head>
<body>
	<div id="container">
		<jsp:include page="/page/common/header.jsp"></jsp:include>
		<div id="kernel" class="center-box">
			<form action="${path }/register.html" method="post" onsubmit="return check();">
				<h1>欢迎加入致-青春</h1>
				<div>
					<label>邮箱</label>
					<input name="email" />
				</div>
				<div>
					<label>密码</label>
					<input name="pwd" type="password" />
				</div>
				<div>
					<label>名号</label>
					<input name="usr" />
				</div>
				<div>
					<label></label>
					<input type="submit" value="注册" />
				</div>
			</form>
		</div>
		<jsp:include page="/page/common/footer.jsp"></jsp:include>
	</div>
</body>
</html>